﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/Edit.Master"  AutoEventWireup="true"  CodeBehind="Bu_Investigate_Edit.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Project.Bu_Investigate_Edit"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<script language="javascript" type="text/javascript" src="../../Scripts/jquery.easyui.min.js"></script>
<link href="../../Styles/easyui.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
        var opts = null;
        function InitRules() {
            opts = {
                 rules:
                 {
                    <%= ddlProject.UniqueID%>:{required: true},
					<%= dtpInvDate.UniqueID%>:{required: true,dateISO: true},
					<%= numGS.UniqueID%>:{required: true,number: true},
					<%= numCZLJ.UniqueID%>:{required: true,number: true},
					<%= numTK.UniqueID%>:{required: true,number: true},
					<%= numOutputValue.UniqueID%>:{required: true,number: true},
					<%= numP_ZF.UniqueID%>:{required: true,number: true},
					<%= numP_XX.UniqueID%>:{required: true,number: true},
					<%= numP_GC.UniqueID%>:{required: true,number: true},
					<%= dtpPlanStartDate.UniqueID%>:{required: true,dateISO: true},
					<%= dtpPlanEndDate.UniqueID%>:{required: true,dateISO: true},
					<%= dtpStartDate.UniqueID%>:{required: true,dateISO: true},
					<%= dtpEndDate.UniqueID%>:{required: true,dateISO: true}					
                 },
                 messages:
                 {
                    <%= ddlProject.UniqueID%>:{required: "项目名称 请选择合适的值"},
					<%= dtpInvDate.UniqueID%>:{required: "考察日期 请选择合适的值",dateISO: "考察日期 请选择有效的日期"},
					<%= numGS.UniqueID%>:{required: "项目概算 请输入合适的值",number: "项目概算 请输入有效的数字"},
					<%= numCZLJ.UniqueID%>:{required: "财政已支付 请输入合适的值",number: "财政已支付 请输入有效的数字"},
					<%= numTK.UniqueID%>:{required: "投控已审核 请输入合适的值",number: "投控已审核 请输入有效的数字"},
					<%= numOutputValue.UniqueID%>:{required: "累计完成产值 请输入合适的值",number: "累计完成产值 请输入有效的数字"},
					<%= numP_ZF.UniqueID%>:{required: "资金支付进度 请输入合适的值",number: "资金支付进度 请输入有效的数字"},
					<%= numP_XX.UniqueID%>:{required: "形象进度 请输入合适的值",number: "形象进度 请输入有效的数字"},
					<%= numP_GC.UniqueID%>:{required: "工程进度 请输入合适的值",number: "工程进度 请输入有效的数字"},
					<%= dtpPlanStartDate.UniqueID%>:{required: "计划开工日期 请选择合适的值",dateISO: "计划开工日期 请选择有效的日期"},
					<%= dtpPlanEndDate.UniqueID%>:{required: "计划竣工日期 请选择合适的值",dateISO: "计划竣工日期 请选择有效的日期"},
					<%= dtpStartDate.UniqueID%>:{required: "实际开工日期 请选择合适的值",dateISO: "实际开工日期 请选择有效的日期"},
					<%= dtpEndDate.UniqueID%>:{required: "实际竣工日期 请选择合适的值",dateISO: "实际竣工日期 请选择有效的日期"}					
                 },
                 onfocusout:false,
                 onclick:false,
                 onkeyup:false,
                 errorPlacement: function(error, element) {
                    $("#errorContainer").show();
                    error.html("<li>* "+error.html()+"</li>");
                    error.appendTo("#errorContainer");
                 },
                 wrapper:"li"
            }
        }
        function setProject(id){
            document.getElementById("<%=hidProjectID.ClientID %>").value=id;
        }
        function getProject(){
            var id=document.getElementById("<%=hidProjectID.ClientID %>").value;
            var date=document.getElementById("<%=dtpInvDate.ClientID %>").value;
            if(id=="" || date==""){
                return;
            }            
            $.ajax({
                type: "POST",
                url: 'Json/GetProjectByID.ashx?ID=' +id + '&InvDate='+date+'&randID=' + escape(new Date()),
                success: function (msg) {
                    var arrRet = msg.split('|');
                    document.getElementById("<%=numGS.ClientID %>").value=arrRet[0];
                    document.getElementById("<%=dtpPlanStartDate.ClientID %>").value=arrRet[1];
                    document.getElementById("<%=dtpPlanEndDate.ClientID %>").value=arrRet[2];
                    document.getElementById("<%=dtpStartDate.ClientID %>").value=arrRet[3];
                    document.getElementById("<%=dtpEndDate.ClientID %>").value=arrRet[4];
                    document.getElementById("<%=numCZLJ.ClientID %>").value=arrRet[5];
                    document.getElementById("<%=numTK.ClientID %>").value=arrRet[6];
                    document.getElementById("<%=numP_ZF.ClientID %>").value=arrRet[7];                    
                    document.getElementById("<%=txtDescription.ClientID %>").focus();
                    
                },
                error: function () { }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit" style="border-bottom:0px;margin-top:2px;">
            <th style="border-bottom:0px">现场考察维护</th>
        </table>
        <table cellpadding="0" width="100%" cellspacing="0" border="1" class="tEdit">
		<tr>
			<td class="title1" style="width:140px;" >项目名称<span class="req">﹡</span></td>
			<td colspan="3">
                <asp:DropDownList runat="server" ID="ddlProject" onchange="setProject(this.value);getProject();" Width="98%" CssClass="input2"></asp:DropDownList>
            </td>
		</tr>
        <tr>
            <td style="width:140px;" class="title1">考察日期<span class="req">﹡</span></td>
			<td><asp:TextBox ID="dtpInvDate" runat="server" cssClass="input2" onpropertychange="getProject();" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
            <td style="width:140px;" class="title1">项目概算<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numGS" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
        </tr>        
		<tr>
			<td class="title1">计划开工日期<span class="req">﹡</span></td>
			<td><asp:TextBox ID="dtpPlanStartDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
			<td class="title1">计划竣工日期<span class="req">﹡</span></td>
			<td><asp:TextBox ID="dtpPlanEndDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">实际开工日期<span class="req">﹡</span></td>
			<td><asp:TextBox ID="dtpStartDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
			<td class="title1">实际竣工日期<span class="req">﹡</span></td>
			<td><asp:TextBox ID="dtpEndDate" runat="server" cssClass="input2" onfocus="setday(this);" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">财政已支付金额(元)<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numCZLJ" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
			<td class="title1">投控已审核金额(元)<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numTK" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">累计完成产值(元)<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numOutputValue" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
			<td class="title1">资金支付进度(%)<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numP_ZF" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
		</tr>
		<tr>
			<td class="title1">形象进度(%)<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numP_XX" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
			<td class="title1">工程进度(%)<span class="req">﹡</span></td>
			<td><asp:TextBox ID="numP_GC" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isDecimal();" Width="96%"></asp:TextBox></td>
		</tr>
        <tr>
			<td class="title1">说明</td>
			<td colspan="3"><asp:TextBox ID="txtDescription" runat="server"  cssClass="input2" TextMode="MultiLine" Rows="6" MaxLength="500" Width="96%"></asp:TextBox></td>
		</tr>
        </table>
        <asp:HiddenField runat="server" ID="hidProjectID" />
        <div class="save_area">
            <asp:Button runat="server" ID="btnOK" Text="确定" class="btn_normal" 
                onmouseover="this.className='btn_active'" 
                onmouseout="this.className='btn_normal'" onclick="btnOK_Click"/>
            <input type="button" id="btnExit" value="取消" onclick="javascript:window.returnValue=false;window.close();" class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" />
        </div>
</asp:Content>


